
<?php
    include_once('Configs/database.php');
    class DeCuongHPChiTiet extends database{
        //private $manganh;
        private $mahp;
        private $madc;
		private $noidungvt;
        private $noidung;
        private $sotiet;
        private $ghichu;
        /*public function setMaNganh($manganh){
            $this->manganh = $manganh;
        }*/
        public function setMaHP($mahp){
            $this->mahp = $mahp;
        }
        public function setMaDC($madc){
            $this->madc = $madc;
        }
        public function setNoiDung($noidung){
            $this->noidung = $noidung;
        }
        public function setSoTiet($sotiet){
            $this->sotiet = $sotiet;
        }
        public function setGhiChu($ghichu){
            $this->ghichu = $ghichu;
        }
        /*public function getMaNganh(){
            return $this->manganh;
        }*/
        public function getMaHP(){
            return $this->mahp;
        }
        public function getMaDC(){
            return $this->madc;
        }
        public function getNoiDung(){
            return $this->noidung;
        }
		public function setNoiDungVT($noidungvt){
            $this->noidungvt = $noidungvt;
        }
		public function getNoiDungVT(){
            return $this->noidungvt;
        }
        
        public function getSoTiet(){
            return $this->sotiet;
        }
        public function getGhiChu(){
            return $this->ghichu;
        }
        public function themDeCuongHPChiTiet(){                          
             $this->setQuery("insert into DeCuongHPChiTiet(madc,mahp,noidungvt,noidung,sotiet,ghichu) values ('".$this->getMaDC()."','".$this->getMaHP()."','".$this->getNoiDungVT()."','".$this->getNoiDung()."',".$this->getSoTiet().",'".$this->getGhiChu()."')");
             //echo $this->getQuery();             
             return $this->executeQuery();
         }
         public function suaDeCuongHPChiTiet(){
            $this->setQuery("update DeCuongHPChiTiet set mahp='".$this->getMaHP()."',noidungvt='".$this->getNoiDungVT()."',noidung='".$this->getNoiDung()."',sotiet=".$this->getSoTiet().",ghichu='".$this->getGhiChu()."' where  madc='".$this->getMaDC()."'");                    
            return $this->executeQuery();
         }
         public function xoaDeCuongHPChiTiet(){
            $this->setQuery("delete DeCuongHPChiTiet where  madc='".$this->getMaDC()."'");
            //echo $this->getQuery();
            return $this->executeQuery();
         }
         public function thongtinDeCuongHPChiTiet($madc){
            $this->setQuery("select * from DeCuongHPChiTiet where madc='".$madc."'");            
            return $this->fetchAll();
         }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
         /*public function dsDeCuongChiTietCuaHP(){
            $this->setQuery("select * from DeCuongHPChiTiet where  mahp = '".$this->getMaHP()."'");            
            return $this->fetchAll();
         }*/
         /*public function dsDeCuongCTTheoNganhHP($mahp){
            $this->setQuery("select * from DeCuongHPChiTiet where  mahp = '".$mahp."'");            
            return $this->fetchAll();
         }*/
         
         /*public function xemDeCuongHP(){
            $this->setQuery("select * from DeCuongHPChiTiet a, HocPhan b, NganhHoc c, Khoa d where  b.mahp='".$this->getMaHP()."'  and a.mahp = b.mahp and a.manganh = c.manganh and c.makhoa=d.makhoa");
            return $this->fetchAll();
         }*/
        /*public function themDeCuongHPChiTiet(){                          
             $this->setQuery("insert into DeCuongHPChiTiet(manganh,mahp,stt,noidungvt,noidung,sotiet,ghichu) values ('".$this->getMaNganh()."','".$this->getMaHP()."',".$this->getSTT().",'".$this->getNoiDungVT()."','".$this->getNoiDung()."',".$this->getSoTiet().",'".$this->getGhiChu()."')");             
             return $this->executeQuery();
         }
         public function suaDeCuongHPChiTiet(){
            $this->setQuery("update DeCuongHPChiTiet set noidungvt='".$this->getNoiDungVT()."',noidung='".$this->getNoiDung()."',sotiet=".$this->getSoTiet().",ghichu='".$this->getGhiChu()."' where manganh='".$this->getMaNganh()."' and mahp='".$this->getMaHP()."' and stt=".$this->getSTT()."");                    
            return $this->executeQuery();
         }
         public function xoaDeCuongHPChiTiet(){
            $this->setQuery("delete from DeCuongHPChiTiet where manganh='".$this->getMaNganh()."' and mahp='".$this->getMaHP()."' and stt=".$this->getSTT()."");
            return $this->executeQuery();
         }
         public function dsDeCuongCTTheoNganhHP($manganh,$mahp){
            $this->setQuery("select * from DeCuongHPChiTiet where manganh='".$manganh."' and mahp = '".$mahp."'");            
            return $this->fetchAll();
         }
         public function thongtinDeCuongHPChiTiet($manganh,$mahp,$stt){
            $this->setQuery("select * from DeCuongHPChiTiet where manganh='".$manganh."' and mahp = '".$mahp."' and stt='".$stt."'");            
            return $this->fetchAll();
         }
         /*public function dsTatCaBM(){
            $this->setQuery("select * from DeCuongHPChiTiet");
            return $this->fetchAll();
         }*/
    }  
?>
